package com.aabte.design2.behavioral.visitor;

import lombok.Data;

/**
 * @author Daniel
 * @version 1.0
 * @date 2020/5/4
 */
@Data
public class Dot implements Shape {

    private int x;
    private int y;

    public Dot(int x, int y) {
        this.x = x;
        this.y = y;
    }

    /**
     * 注意我们正在调用的`visitDot（访问点）`方法与当前类的名称相匹配
     * 这样我们能让访问者知晓与其交互的元素类
     *
     * @param visitor
     */
    @Override
    public void accept(Visitor visitor) {
        visitor.visitDot(this);
    }
}
